<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:dt="http://java.sun.com/jsf/composite/components"
                xmlns:p="http://primefaces.org/ui"
                template="./template1.xhtml">
    
    <ui:define name="mainContent">
        <h2><a href="schedule.xhtml">Schedule</a> | History</h2>
        <ul id="games">
            <h:panelGrid id="historyList">
                <h:outputText value="#{leagueBean.activeTeam}" /><br/>
                <ui:repeat value="#{leagueBean.historyList}" var="week">
                <li>
                        <h3 class="fancy">Week #{week.number}</h3>
                        <ui:repeat value="#{week.matches}" var="match">
                                <p><i>#{match.matchup}</i><br/>
                                #{match.score}<br/></p>
                        </ui:repeat>
                </li>
                </ui:repeat>
            </h:panelGrid>
        </ul>
    </ui:define>
    
    <ui:define name="secondaryContent">
        <h3>Teams</h3>
        <h:panelGrid id="teams">
            <p:commandLink update="teams,historyList" >
                <f:setPropertyActionListener target="#{leagueBean.activeTeam}" value="All Teams" />
                <h:outputText value="All Teams" />
            </p:commandLink>
            <ui:repeat value="#{leagueBean.teams}" var="team" >
                <p:commandLink update=":teams,:historyList" >
                    <f:setPropertyActionListener target="#{leagueBean.activeTeam}" value="#{team}" />
                    <h:outputText value="#{team}" /><br/>
                </p:commandLink>
            </ui:repeat>
        </h:panelGrid>
    </ui:define>
    
</ui:composition>
